#ifndef __GUI_core_H__
#define __GUI_core_H__

#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include "picure.h"



#define LCD_GUI_WIDTH         240     //屏幕宽度
#define LCD_GUI_HEIGHT        280     //屏幕高度

#define LCD_DIV_REFRESH       1       //分屏系数

#define LCD_REFRESH_UNIT   (LCD_GUI_HEIGHT/LCD_DIV_REFRESH)  //刷新单元


#define SCROLL_Y_OFFSET        20         //垂直滚动系数

#define SCROLL_X_OFFSET        20         //水平滚动系数

typedef struct
{
	uint16_t Width;    //图片宽度
	uint16_t Height;   //图片高度
	uint32_t Address;  //图片存在的flash地址
	uint8_t  Alpha;    //是否为透明属性
}Image_Information_t;


typedef struct
{

	uint16_t Xstart;           //x起始地址
	uint16_t Ystart;           //y起始地址
	uint16_t Xoffset;          //x滑动偏移位置
	uint16_t Yoffset;          //y滑动偏移位置
	Image_Information_t  image;

}GUI_Obj_t;



typedef enum
{
  Alpha_false=0,
  Alpha_true =1, 
}
Is_Alpha_t;



typedef  enum
{
    Move_None  =0,
  	Move_Up    =1,
  	Move_Down  =2,
  	Move_Left  =3,
  	Move_Right =4,
    Move_End   =5,
}Move_Dir_t;


void LCD_Draw_Image(uint16_t xstart,uint16_t ystart,uint16_t xend,uint16_t yend,uint32_t address);


void Clear_LCD_Display_Buf1();//清除缓冲区1
void Clear_LCD_Display_Buf2();//清除缓冲区2


void GUI_Horizon_Scroll(uint16_t xoffset,Move_Dir_t dir); //水平滚动
void GUI_Vertical_Scroll(uint16_t yoffset);  //垂直滚动

void LCD_Vertical_Scroll_Display(Move_Dir_t dir,uint16_t yoffset);


void GUI_Write_LCD_Display_Buf_Part(uint16_t xstart,uint16_t ystart,uint16_t xend,uint16_t yend,uint32_t address,uint8_t *display_buf,uint16_t ypos,uint16_t yoffset);



void GUI_Refresh_Handler();//GUI刷新函数
void GUI_Touch_Handler();  //GUI触摸函数


void GUI_Write_LCD_Display_Buf(uint16_t xstart,uint16_t ystart,uint16_t xend,uint16_t yend,uint32_t address,uint8_t *display_buf);


void GUI_LCD_Refresh();//GUI刷屏函数




















#endif
